package riceSystem.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import riceSystem.dao.DaoTemplateInterface;
import riceSystem.entity.Recommand;
import riceSystem.exception.RunException;
import riceSystem.service.ServiceTemplateInterface;
@Component("recommandService")
public class RecommandServiceImpl implements ServiceTemplateInterface<Recommand> {
	
	private DaoTemplateInterface<Recommand> recommandDao;
	
	public DaoTemplateInterface<Recommand> getRecommandDao() {
		return recommandDao;
	}
	@Resource(name="recommandDao")
	public void setRecommandDao(DaoTemplateInterface<Recommand> recommandDao) {
		this.recommandDao = recommandDao;
	}

	public void add(Recommand t) throws RunException {
		recommandDao.save(t);
	}

	public void removeById(long id) throws RunException {
		recommandDao.deleteById(id);
	}

	public void remove(Recommand t) throws RunException {
		recommandDao.delete(t);
	}

	public long update(Recommand t) throws RunException {
		return recommandDao.update(t);
	}

	public Recommand getById(long id) throws RunException {
		return recommandDao.loadById(id);
	}

	public List<Recommand> getAll() throws RunException {
		return recommandDao.loadAll();
	}

}
